Repository navigation
feat(settings): import Ghostty themes, including light/dark pairs, as per-mode terminal themes - #37368
Conversation
e23ca9b to
141de79
Compare
af13425 to
8f70fb6
Compare
bec3d72 to
ce5696c
Compare
|
No actionable comments were generated in the recent review.
|
… per-mode terminal themes
…rs when a theme half is missing
…e divider colors, follow Ghostty lookup order for picked configs
ce5696c to
2e3ddd8
Compare
Summary
Most Ghostty users get their colors from
theme, and that includes thetheme = light:X,dark:Ypair that follows the system appearance. Before this PR, the Ghostty import:Root cause: the import had no notion of Orca's per-mode terminal theme slots, which landed in #36581. It treated a theme as a bag of override colors.
The import now maps
themeonto the slots:theme = Xtheme = light:A,dark:Bbackground =,palette =, …Name resolution follows Ghostty (
src/config/theme.zig):~/…is read directly.$XDG_CONFIG_HOME/ghostty/themes; on Windows,LOCALAPPDATA), then Ghostty's bundled themes:Ghostty.appin/Applicationsor~/Applications$XDG_DATA_DIRS,~/.local/share, or the snap pathGHOSTTY_RESOURCES_DIRthemes/folder next to it is also checked: after the user themes dir, before the bundled themes.-/_and a.confsuffix.What happens with a resolved theme file:
ghostty. If Orca has a built-in with the same name but a different palette, the import is labelled "(Ghostty)". Catppuccin is an example: Ghostty ships a newer palette.Unresolved names and incomplete pairs (
light:Xwith no dark half) show in the preview's unsupported list. The preview shows theme names, not internal IDs.Closes #22640
Refs #36581
Stacked on #37353. This PR will be retargeted to
mainonce that PR lands.Visual proof
The config is
theme = light:Catppuccin Latte,dark:Catppuccin Mocha, on a throwawayHOME/XDG_CONFIG_HOMEwith the real Ghostty.app bundled themes.After Apply: Settings → Terminal Themes, dark slot and light slot.
Merge-risk assessment: Low
terminalThemeDark/Light,terminalUseSeparateLightTheme,terminalColorOverrides(Light)andterminalCustomThemeswith sourceghosttyall exist already, and older Orca versions read them the same way. An older client syncing these settings sees a custom theme it already knows how to render.inferTerminalThemeModenow lives interminal-custom-themes.ts, and the Warp parser reuses it with identical math.TERMINAL_ANSI_COLOR_KEYSis now exported.ghosttyImportSettingsUpdateis new inghostty-import-preview.ts.withImportedTerminalColorOverridesis unchanged.Negative user-facing tradeoffs
themenow changes the selected terminal theme, and clears that slot's existing color overrides. Before, the theme colors were merged into the overrides on top of the current theme. The preview lists both changes before you apply.theme = Xturns on "Match dark mode", so a separate light terminal theme you had chosen is no longer used. This matches Ghostty's single-theme behaviour.Validation
pnpm tc:node,pnpm tc:web: clean. The only error, a pre-existing one from Show agent sign-in notices before the first chat message #37191, is fixed on main by test: fix main's typecheck after the conversation view module moved #37346.pnpm test src/main/ghostty src/main/warp-themes src/renderer/src/components/onboarding src/renderer/src/components/settings/TerminalAppearanceSection.ghostty.test.ts: 275 passed. The rewrittentheme-import.test.tscovers:verify:localization-extraction.ORCA_BACKGROUND_LAUNCH=1, CDP port 9365, throwawayHOME,XDG_CONFIG_HOMEand user-data dir.terminalThemeDark=custom:ghostty:catppuccin-mocha-ghostty,terminalThemeLight=custom:ghostty:catppuccin-latte-ghosttyandterminalUseSeparateLightTheme=true.LOCALAPPDATA, Ghostty's:-only pair syntax with quoted values, the separate-light flag being cleared when the light half is missing, extra Linux install prefixes, returning a patch instead of mutating, and listing only imported names.gpt-6.1-sol, xhigh) took longer than 5 minutes, but it finished, and I acted on its report. Beyond the items above, I fixed:split-divider-colorimports again, with explicit config keys winning;themes/folder now ranks below the user themes dir, so lookup precedence matches Ghostty's.Perf
statper theme search dir per theme name (two names for a pair), stopping at the first hit. Each hit is onereadFile, capped at 256 KB. Orca's catalog lookup map is built lazily, once.Ghostty.appthemes and 30 runs: the preview with a light/dark pair took p50 0.70 ms / p95 0.90 ms. That is the same order as a preview with no theme (PR feat(settings): let the Ghostty import read a config file you pick #37353: p50 0.60 ms).